<!doctype html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="__ADMIN__/css/base.css" />
<link rel="stylesheet" href="__ADMIN__/css/info-mgt.css" />
<link rel="stylesheet" href="__ADMIN__/css/WdatePicker.css" />
<title>移动办公自动化系统</title>
</head>

<body>
<div class="title"><h2>信息管理</h2></div>
<div class="table-operate ue-clear">
	<a href="javascript:;" class="add">添加</a>
    <a href="javascript:;" class="del">删除</a>
    <a href="javascript:;" class="edit">编辑</a>
    <a href="javascript:;" class="count">统计</a>
    <a href="javascript:;" class="check">审核</a>
</div>
<div class="table-box">
	<table>
    	<thead>
        	<tr>
            	<th class="num">序号</th>
                <th class="name">部门</th>
                <th class="process">所属部门</th>
                <th class="node">排序</th>
                <th class="time">备注</th>
                <th class="operate">操作</th>
            </tr>
        </thead>
        <tbody>
            <volist name='data' id='vol'>
        	<tr>
            	<td class="num">{$vol.id}</td>
                <td class="name">{$vol.level|str_repeat='&emsp;',###*2}{$vol.name}</td>
                <td class="process"><if condition='$vol.pid == 0'>顶级部门<else/>{$vol.deptname}</if></td>
                <td class="node">{$vol.sort}</td>
                <td class="time">{$vol.remark}</td>
                <td class="operate">
                <input type="checkbox" value="{$vol.id}"/>
                <a href="__CONTROLLER__/edit/id/{$vol.id}">编辑</a>
                </td>
            </tr>
            </volist>
        </tbody>
    </table>
</div>
<div class="pagination ue-clear"></div>
</body>
<script type="text/javascript" src="__ADMIN__/js/jquery.js"></script>
<script type="text/javascript" src="__ADMIN__/js/common.js"></script>
<script type="text/javascript" src="__ADMIN__/js/WdatePicker.js"></script>
<script type="text/javascript" src="__ADMIN__/js/jquery.pagination.js"></script>
<script type="text/javascript">
$(".select-title").on("click",function(){
	$(".select-list").hide();
	$(this).siblings($(".select-list")).show();
	return false;
})
$(".select-list").on("click","li",function(){
	var txt = $(this).text();
	$(this).parent($(".select-list")).siblings($(".select-title")).find("span").text(txt);
})

$('.pagination').pagination(100,{
	callback: function(page){
		alert(page);	
	},
	display_msg: true,
	setPageNo: true
});

$("tbody").find("tr:odd").css("backgroundColor","#eff6fa");

showRemind('input[type=text], textarea','placeholder');

//jQuery代码
$(function(){
	//给删除按钮绑定点击事件
	$('.del').on('click',function(){
		//事件处理程序
		var idObj = $(':checkbox:checked');	//获取全部已经被选中的checkbox
		var id = '';	//接收处理后的部门id值，组成id1,id2,id3...
		//循环遍历idObj对象，获取其中的每一个值
		for (var i = 0; i < idObj.length; i++) {
			id += idObj[i].value + ',';
		}
		//去掉最后逗号
		id = id.substring(0,id.length - 1);
		//判断id
		if(id == ''){
			return false;
		}
		//带着参数跳转到del方法
		window.location.href = '__CONTROLLER__/del/id/' + id;
	});
});
</script>
</html>
